export default function (phoneNumber, params,templateId) {
  // let appid = sessionStorage.getItem('dxappid')
  let appid = "1400769812"
  // let appkey = sessionStorage.getItem('dxappkey')
  let appkey = "8b0f81c1e86b5fc78832d4979124fbd1"
  // let smssign = sessionStorage.getItem('dxsmssign')
  let smssign = "tom8个8个人公众号"
  // let templateId = sessionStorage.getItem('dxtemplateId')
  // let templateId = "1618600"
  var QcloudSms = require('qcloudsms_js')
  var qcloudsms = QcloudSms(appid, appkey)
  // var smsType = 0
  var ssender = qcloudsms.SmsSingleSender()
  return new Promise(function (resolve, reject) {
    // console.log('短信接受号码:' + phoneNumber)
    // console.log('模版ID:' + templateId)
    // console.log('模版变量:' + params)
    ssender.sendWithParam(86, phoneNumber.split(','), templateId, params, smssign, '', '', function (err, res, resData) {
      if (err) {
        console.log(resData) // reject()
      } else {
        console.log(resData)
        resolve(true)
      }
    })
  })
}
